<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="reportTitle" value="halm机测试 - 小时效率趋势报表" scope="session"/>

<%@ include file="/common/report_head.jsp" %>
<%@ include file="/condition/sartTime_YMDH_input.html"%>
<%@ include file="/condition/endTime_YMDH_input.html"%>
<%@ include file="/condition/fab_sumo_must.html"%>
<%@ include file="/condition/effNo_sumo.html"%>
<%@ include file="/condition/line_sumo.html"%>
<%@ include file="/condition/toolg_sumo.html"%>
<%@ include file="/condition/toolType_radio.html"%>
<%@ include file="/condition/tool_sumo.html"%>
<%@ include file="/condition/waferSpec_sumo.html"%>
<%@ include file="/condition/manufacturer_sumo.html"%>
<%@ include file="/condition/baseIdsumo.html"%>
<%@ include file="/condition/lotId_text.html"%>
<%@ include file="/condition/attributes_sumo.html"%>
<%@ include file="/condition/bin_sumo.html"%>

<%@ include file="/common/report_middle.jsp" %>
<%@ include file="/charts-grid/echarts2.html"%>
<%@ include file="/charts-grid/echarts3.html"%>
<%@include file="/common/report_end.jsp" %>


<script>

    $(document).ready(function () {
        $("title").text("halm机测试 - 档位分布报表");
        $("label:contains('线别:')").addClass("keyCss");

        $('#query_btn').click(function (){
            if($("#bayIdSumo").val() === null || $("#bayIdSumo").val() === '' ) { showErrorDialog("0000002", "线别为必选项"); return false; }
            initGridAndChart();
            ajax('/jn-report/report/halm_hourEfficiencyTrend_report.do' ,loadConditionMapData(), true, ajax_successful);

            function ajax_successful(outTrxObj) {
                if(outTrxObj.gridData.length < 1) { showMessengerDialog("数据查询为空"); return false; }

                //Chart图数据
                if ($("#charts").length > 0) {
                    var echartsData = outTrxObj.chartsData;
                    option.title.text = echartsData.title;
                    option.legend.data = [];
                    option.legend.data = ['效率1','效率2'];
                    option.grid.bottom = '20%';
                    option.xAxis[0].data = [];
                    option.xAxis[0].data = echartsData.xAxisData;
                    option.xAxis[0].axisLabel = {
                        interval:0,
                        rotate:48
                    };
                    option.yAxis = [];
                    option.yAxis = [
                        {
                            type: 'value',
                            //default: false,
                            splitLine:{show:false},
                            axisLabel: {formatter: '{value} %'},
                            scale : true,
                            boundaryGap: ['0%', '22%']
                        }
                    ];
                    option.series = [];
                    //柱状图
                    option.series.push({
                        name: "效率1",
                        type: 'bar',
                        yAxisIndex: 0,
                        data: echartsData.seriesDatas[0],
                        barMaxWidth : 20,
                        itemStyle: {
                            normal: { color: '#5194D2' }
                        }
                    });
                    //折线图
                    for (var i = 1; i < echartsData.seriesDatas.length; i++) {
                        option.series.push({
                            name: '效率2',
                            type: 'line',
                            yAxisIndex: 0,
                            data: echartsData.seriesDatas[i],
                            itemStyle: {
                                normal: {lineStyle: {color: '#E97627'}}
                            },
                            label: {
                                normal: {
                                    show: true,
                                    distance: 5,
                                    color: '#A9A9A9',
                                    fontWeight: 'bold',
                                    formatter: '{c}%'
                                }
                            },
                            animationDelay: function (idx) {
                                return idx * 10 + 100;
                            }
                        });
                    }
                    option.legend.left = '7%';
                    option.backgroundColor = 'white';
                    option.grid.show = false;
                    myChart.clear();
                    myChart.setOption(option);
                }


                //Chart3图数据
                if ($("#charts3").length > 0) {
                    var echartsData = outTrxObj.chartsData2;
                    option3.title.text = echartsData.title;
                    option3.legend.data = [];
                    option3.legend.data = ['系列一','系列二'];
                    option3.grid.bottom = '20%';
                    option3.xAxis[0].data = [];
                    option3.xAxis[0].data = echartsData.xAxisData;
                    option3.xAxis[0].axisLabel = {
                        interval:0,
                        rotate:48
                    };
                    option3.yAxis = [];
                    option3.yAxis = [
                        {
                            type: 'value',
                            //default: false,
                            splitLine:{show:false},
                            axisLabel: {formatter: '{value} %'},
                            scale : true,
                            boundaryGap: ['0%', '22%']
                        }
                    ];
                    option3.series = [];
                    //柱状图
                    option3.series.push({
                        name: "系列一",
                        type: 'bar',
                        yAxisIndex: 0,
                        data: echartsData.seriesDatas[0],
                        barMaxWidth : 20,
                        itemStyle: {
                            normal: { color: '#5194D2' }
                        }
                    });
                    //折线图
                    for (var i = 1; i < echartsData.seriesDatas.length; i++) {
                        option3.series.push({
                            name: '系列二',
                            type: 'line',
                            yAxisIndex: 0,
                            data: echartsData.seriesDatas[i],
                            itemStyle: {
                                normal: {lineStyle: {color: '#E97627'}}
                            },
                            label: {
                                normal: {
                                    show: true,
                                    distance: 5,
                                    color: '#A9A9A9',
                                    fontWeight: 'bold',
                                    formatter: '{c}%'
                                }
                            },
                            animationDelay: function (idx) {
                                return idx * 10 + 100;
                            }
                        });
                    }
                    option3.legend.left = '7%';
                    option3.backgroundColor = 'white';
                    option3.grid.show = false;
                    myChart3.clear();
                    myChart3.setOption(option3);
                }

            }
        });

    });
</script>
